<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="./vue.js"></script>
</head>

<body>
  <!-- 可以让用户选择账户登录还是邮箱登录 用按钮切换 -->
  <div id="app">
    <span v-if="isUser">
      <label for="username">用户账号：</label>
      <input type="text" key="username" id="username" placeholder="请输入账号">
    </span>
    <span v-else>
      <label for="email">用户邮箱：</label>
      <input type="text" key="email" id="email" placeholder="请输入邮箱">
    </span>
    <button @click="btnClick">切换类型</button>
  </div>

  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        name: 'Taec',
        isUser: true //定义一个变量用于确定是用户账号登录还是邮箱登录
      },
      methods: {
        btnClick() {
          this.isUser = !this.isUser
        }
      }
    })
  </script>
</body>

</html>